package SingleLinkList;


public class Node <E>{
	public E data;
	public Node<E> next;
	
	//constructor
	
	/**creates a new node with a null next field
	 * @param dataItem
	 */
	public Node(E dataItem){
		data = dataItem;
		next = null;
	}
	
	/**creates a new node that references another node
	 * @param dataItem
	 * @param nodeRef 
	 */
	public Node(E dataItem, Node<E> nodeRef){
		data = dataItem;
		next = nodeRef;
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Node<String> tom = new Node<String>("Tom");
		Node<String> dick = new Node<String>("Dick");
		Node<String> harry = new Node<String>("Harry");
		Node<String> sam = new Node<String>("Sam");
		
		tom.next=dick;
		dick.next=harry;
		harry.next=sam;
	}

}
